#数组(array)
names_mixed=["张天泽",123,"李立平"]
names_empty=[]
print "数组大小:",names_mixed.size,"\n"
print "第三个:",names_mixed[2],"\n"
#数组.each do |var| end
names_mixed.each do |n|
    print n," "
end

#符号(symbol)
sym=:foo
sym2=:"foo" #同上
puts sym
str="foo"
print sym.to_s==str,str.to_sym==sym2,"\n" #to_s,to_sym

#散列(hash)
person1={:name=>"李立平",:sex=>"男"}
person2={"name"=>"李立平","sex"=>"男"}
person3={11=>"李立平",12=>"男"} # key=>object
person1_1={name:"李立平",sex:"男"} #对于符号的简写
print person1[:name],person2["name"],person3[11],"\n"
#散列.each do |key,value| end
person1_1.each do |key,value|
    puts "#{key}:#{value}"
end

#正则表达式
reg=/Ruby/
p reg=~"Ruby" #=>0
p reg=~"ARuby" #=>1
p /Ruby/i=~"ruby" #=>0 无视大小写
p reg=~"RUBY" #=>nil